package com.example.springboot.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.springboot.entity.RoleEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@Schema(description = "用户列表返回参数")
public class UserResp {
    @Schema(description = "序号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "用户账号")
    @TableField("userId")
    private String userId;

    @Schema(description = "密码")
    @TableField("passwd")
    private String passwd;

    @Schema(description = "名称")
    @TableField("username")
    private String username;

    @Schema(description = "性别")
    @TableField("gender")
    private Integer gender;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "生日")
    @TableField("birth")
    private Date birth;

    @Schema(description = "权限")
    @TableField("roleId")
    private Integer roleId;

    @Schema(description = "状态")
    @TableField("state")
    private Integer state;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField("createTime")
    private Date createTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    @TableField("updateTime")
    private Date updateTime;

    @Schema(description = "权限详情")
    private RoleEntity roleEntity;

}
